package com.wang.myblog.mapper;

import com.wang.myblog.entity.Statistics;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Mapper
@Repository
public interface StatisticsMapper {

    int insert(Statistics statistics);

    int addCount(Date date);

    List<Statistics> queryAll();

    Statistics queryByDate(Date date);

    //获取最近10天统计信息
    List<Statistics> getRecentRequests();

    /*获取各时间段访问量
     *type:-1:总共；365：最近一年；30：最近30天；7：最近7天
     */
    Integer getRequestCount(Integer type);

}
